Political Affiliation Predictions — (166 people classified)
Model
Logistic Regression
Test Accuracy
0.590
Number of Classes Predicted
3
| affiliation | count | percent | |
|---|---|---|---|
| 0 | Independent | 62 | 37.3 |
| 1 | Democrat | 60 | 36.1 |
| 2 | Republican | 44 | 26.5 |
Pipeline(steps=[('preprocess',
ColumnTransformer(transformers=[('num', StandardScaler(),
['Q2', 'Q15', 'Q16', 'Q17']),
('cat',
OneHotEncoder(handle_unknown='ignore'),
['Q1', 'Q4', 'Q5', 'Q6', 'Q7',
'Q8', 'Q9', 'Q10', 'Q11',
'Q12', 'Q13', 'Q14',
'Q18'])])),
('model',
LogisticRegression(max_iter=5000, multi_class='multinomial'))])In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. Pipeline(steps=[('preprocess',
ColumnTransformer(transformers=[('num', StandardScaler(),
['Q2', 'Q15', 'Q16', 'Q17']),
('cat',
OneHotEncoder(handle_unknown='ignore'),
['Q1', 'Q4', 'Q5', 'Q6', 'Q7',
'Q8', 'Q9', 'Q10', 'Q11',
'Q12', 'Q13', 'Q14',
'Q18'])])),
('model',
LogisticRegression(max_iter=5000, multi_class='multinomial'))])ColumnTransformer(transformers=[('num', StandardScaler(),
['Q2', 'Q15', 'Q16', 'Q17']),
('cat', OneHotEncoder(handle_unknown='ignore'),
['Q1', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9',
'Q10', 'Q11', 'Q12', 'Q13', 'Q14', 'Q18'])])['Q2', 'Q15', 'Q16', 'Q17']
StandardScaler()
['Q1', 'Q4', 'Q5', 'Q6', 'Q7', 'Q8', 'Q9', 'Q10', 'Q11', 'Q12', 'Q13', 'Q14', 'Q18']
OneHotEncoder(handle_unknown='ignore')
LogisticRegression(max_iter=5000, multi_class='multinomial')
| Predicted | Democrat | Independent | Republican | Row Total |
|---|---|---|---|---|
| Actual | ||||
| Democrat | 45 | 11 | 3 | 59 |
| Independent | 13 | 36 | 7 | 56 |
| Republican | 4 | 7 | 43 | 54 |
| Column Total | 62 | 54 | 53 | 169 |
| Metric | Value |
|---|---|
| Accuracy | 0.59036 |
| Total Predictions | 166 |
| Number of Classes | 3 |